package com.example.springboot01.profile;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

/**
 * @Description : 类描述
 * Created by cyd on 2021-04-30 23:07:47
 */
@Configuration
public class ProfileConfig {
    @Bean
    @Profile("dev")
    public DemoBean devDemoBean() {
        // dev模式时注入容器的bean
        return new DemoBean("dev");
    }

    @Bean
    @Profile("pro")
    public DemoBean proDemoBean() {
        // pro模式时，注入容器的bean
        return new DemoBean("pro");
    }
}
